﻿$(function() {
	/**
	 * 滑条---天
	 * */
	var myDate = new Date();
    var year = myDate.getFullYear();
    var month = myDate.getMonth()+1;
    if (month<10){
        month = "0"+month;
    }
    var firstDay = year+"-"+month+"-01";
    myDate = new Date(year,month,0);
    var lastDay = year+"-"+month+"-"+myDate.getDate();
    var min=moment(firstDay).format("x");
    var max=moment(lastDay).format("x");
	//slider组件
	 $('#ss').slider({
        mode: 'h', 
        showTip:true,
        height:32,
        min:min,
        max:max,
        step:86400000,
        tipFormatter: function(value){
//        	console.log("---1---"+moment(value).format('YYYY-MM-DD'));
        	return moment(value).format('YYYY-MM-DD');
        }
    });
 	 /**
 	  * 控制选择的时间最大值不能超过当前日期
 	  */
	 $(".checktime").datebox('calendar').calendar({
			validator: function(date){
				var now=new Date();
				if(date>now){
					return false;
				}else{
					return true;
				}
			}
		}); 
	 $(".checktimestart").datebox('calendar').calendar({
			validator: function(date){
				var now=new Date();
				if(date>now){
					return false;
				}else{
					return true;
				}
			}
		});
});